package com.byjh.quartz.task;

import com.byjh.app.domain.Chapter;
import com.byjh.app.service.IChapterService;
import com.byjh.common.constant.Constants;
import com.byjh.common.utils.StringUtils;
import com.byjh.common.utils.WechatUtils;
import com.byjh.system.service.ISysConfigService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

/**
 * 定时任务调度测试
 *
 * @author dhq
 */
@Component("subject")
public class SubjectTask {
    @Resource
    private IChapterService chapterService;

    /**
     * 更新题库数量(每小时执行)
     */
    public void updQuestionQuantity() {
        List<Chapter> chapterList = chapterService.selectChapterList(null);
        for (Chapter chapter : chapterList) {
            chapterService.updateChapterQuantityByChapterId(chapter.getId());
        }
    }

}
